﻿<%@ include file="/common/validate.jsp"%>
<%
    // 检测版本信息
    Integer type = input.getInt("type", 2);  // 1为iOS 2为Android
    appType = input.getDesc("app_type", "patient");
    List<Map> list = QBuilder.db("basedb").select("new map(versionCode as version_code, version as version, description as description, url as url, CONCAT(FROM_UNIXTIME(cTime / 1000, '%Y-%m-%d'), '') as time)").from("AppVersion").where(new Where("hospital=", hospital).and("type=", type).and("status=", STATUS_ENABLE).and("appType=", appType)).order("versionCode", QBuilder.desc).page(1, 1).query().getResultObj();
    if (isEmpty(list)) {
        msg = new Message(30041, "已是最新版本无需更新");
		Tools.encryptPrint(out, msg);
		return;
    }
    msg.put("data", list.get(0));
    Tools.encryptPrint(out, msg);
%>
